aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/invoice/[id]/+layout.server.js
blob: 690deda0eb3862b058cea3f5252e9d3a9b24aa3f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import Qr from 'qrcode-svg';
import { get } from '$lib/utils';

export async function load({ params }) {
	let { id } = params;
	let invoice = await get(`/invoice?uuid=${id}`);
	let svg = new Qr({
		content: invoice.text,
		join: true,
		container: 'svg-viewbox'
	}).svg();

	return { id, invoice, svg };
}